$(document)
		.ready(
				function() {

					$("#content > div").hide();
					$("#content > div:eq(0)").show();
					$("#tabs > a:eq(0)").css("background",
							"url('imagens/icones/imagemBotaoHover.png')");
					$("#tabs > a:eq(0)").css("color", "black");

					var loc = location.search.substring(1,
							location.search.length);
					var param_value = false;
					var params = loc.split("&");

					if ((param_value = params[0].substring(params[0]
							.indexOf('=') + 1) == "editar")) {
						acao = document.getElementById("formCadastro").getAttribute("action");
						var paramsForms = acao.split("?");
						//alert(paramsForms[1]);
						//document.getElementById("formCadastro").setAttribute(, "action");
						texto2 = paramsForms[1];
						teste = texto2.split("&");
						alert(params[1]);
					//	alert(paramsForms[0]+'?'+'opcao=atualizar'+paramsForms[1].split("&")[1]);
						$('#formCadastro').attr('action',paramsForms[0]+'?'+'opcao=atualizar'+paramsForms[1]);
						opentab(2);
					}
					if ((param_value = params[0].substring(params[1]
							.indexOf('=')) == "enviar")) {
						opentab(2);
					}

				});

function opentab(num) {
	$("#content > div").hide();
	$("#content > div:eq(" + (num - 1) + ")").fadeIn();
	$("#tabs > a").css("background", "#333399");
	$("#tabs > a").css("color", "silver");
	$("#tabs > a:eq(" + (num - 1) + ")").css("background",
			"url('imagens/icones/imagemBotaoHover.png')");
	$("#tabs > a:eq(" + (num - 1) + ")").css("color", "black");
}
